//
//  BirthdayViewModel.m
//  HonlivApp
//
//  Created by admin on 2017/6/26.
//  Copyright © 2017年 honliv. All rights reserved.
//

#import "BirthdayViewModel.h"
#import "BirthdayModel.h"

@implementation BirthdayViewModel

-(void)getBirthdayDatasSuccess:(void (^)(NSArray *))completion{
    //{db:"apilkoa",SqlNo:"66"}
    NSDictionary *dic = @{@"db":@"apilkoa",@"SqlNo":@"66"};
    NSString *url = [NSString stringWithFormat:@"%@%@",HOSPITAL_URL,COMMON_URL];
    [NetWorker getCommonDatasWithURLStr:url body:dic success:^(id result) {
        NSArray *arr = [JsonHelper arrayWithJsonString:result[@"Entity"]];
        NSMutableArray *modelArr = [NSMutableArray array];
        for (NSDictionary *dic in arr) {
            BirthdayModel *model = [BirthdayModel yy_modelWithJSON:dic];
            [modelArr addObject:model];
        }
        completion(modelArr);
    } failure:^(id result) {
        completion([NSArray array]);
    }];

}

@end
